package com.anjubao.parking.municipal.parkinglot.mapper;

import com.anjubao.parking.municipal.parkinglot.dto.ParkingStatFailuresDevicesDto;
import com.anjubao.parking.municipal.parkinglot.dto.ParkingStatFailuresZonesDto;
import com.anjubao.parking.municipal.parkinglot.dto.ParkingTrendFailuresDto;
import com.anjubao.parking.municipal.parkinglot.model.ParkingLotDeviceLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author anjubao
 */
@Mapper
@Repository
public interface ParkingStatFailuresMapper extends BaseMapper<ParkingLotDeviceLog> {

    /**
     * 各区域运维事件排名/故障设备占比统计
     * @param cityId
     * @param tab
     * @return
     */
    List<ParkingStatFailuresZonesDto> getFailuresRecordsZones(Integer cityId,@Param("tab") String tab);

    /**
     * 设备运维事件占比统计
     * @param cityId
     * @return
     */
    List<ParkingStatFailuresDevicesDto> getFailuresRecordsDevices(Integer cityId);

    /**
     * 最近30天运维事件趋势
     * @param cityId
     * @return
     */
    List<ParkingTrendFailuresDto> getTrendFailures(Integer cityId);

    Long getWarningListTotal();
}
